<?php
return [
    'name' => 'API Framework',
    'env' => getenv('APP_ENV') ?: 'production',
    'debug' => filter_var(getenv('APP_DEBUG') ?: false, FILTER_VALIDATE_BOOLEAN),
    'url' => getenv('APP_URL') ?: 'http://localhost',
    'timezone' => getenv('APP_TIMEZONE') ?: 'UTC',
    
    // 加密密钥
    'key' => getenv('APP_KEY') ?: 'base64:your-random-key-here',
    'cipher' => 'AES-256-CBC',
    
    // JWT配置
    'jwt' => [
        'secret' => getenv('JWT_SECRET') ?: 'your-jwt-secret-key',
        'algo' => 'HS256',
        'ttl' => getenv('JWT_TTL') ?: 60, // 分钟
        'refresh_ttl' => getenv('JWT_REFRESH_TTL') ?: 20160, // 分钟 (2周)
    ],
    
    // 日志配置
    'log' => [
        'channel' => getenv('LOG_CHANNEL') ?: 'single',
        'level' => getenv('LOG_LEVEL') ?: 'debug',
    ],
    
    // CORS配置
    'cors' => [
        'allowed_origins' => ['*'],
        'allowed_methods' => ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
        'allowed_headers' => ['Content-Type', 'Authorization', 'X-Requested-With'],
        'exposed_headers' => [],
        'max_age' => 0,
        'supports_credentials' => false,
    ],
    
    // API配置
    'api' => [
        'prefix' => 'api',
        'version' => 'v1',
        'throttle' => [
            'enabled' => true,
            'limit' => 60,
            'expires' => 1, // 分钟
        ],
    ],
];